import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'
import './index.css'
import { AtInput, AtGrid, AtList, AtListItem, AtRadio, AtButton, AtForm,AtCheckbox } from 'taro-ui'
import { $navigateTo } from '../../../global'
import app from '../../../main.js'
export default class index extends Component {
  config = {
    navigationBarTitleText: '健康档案'
  }
  wenzhen = () => {
    $navigateTo("../wenzhenliebiao/index")
  }
  geren = () => {
    $navigateTo("../gerenzhongxinzhuye/index")
  }
  dianzi = () => {
    $navigateTo("../dianzibingli/index")
  }
  componentWillMount() { }

  componentDidMount() { }

  componentWillUnmount() { }

  componentDidShow() { }

  componentDidHide() { }
  constructor() {
    super(...arguments)
    this.state = {
      value: '',
      checkedList: ['list1']
    }
    this.checkboxOption = [{
      value: 'list1',
      label: '糖尿病',
    },{
      value: 'list2',
      label: '高血压'
    },{
      value: 'list3',
      label: '心脏病',
    },{
      value: 'list4',
      label: '哮喘',
  }]
  this.checkboxOption1 = [{
    value: 'list1',
    label: '肝炎',
  },{
    value: 'list2',
    label: '结核病'
  }]
  }
  handleChange(value) {
    this.setState({
      value,
      checkedList: value,
      checkedList1: value
    })
  }

  render() {
    return (
      <View className='index'>
        <AtList hasBorder={false}>
          <AtListItem
            title='姓名：江小白'
            hasBorder={false}
          />
        </AtList>

        <View>
          <AtList hasBorder={false}>
            <AtListItem
              title='性别：'

              onSwitchChange={this.handleChange}
            />
            <AtListItem
              title='男'

              onSwitchChange={this.handleChange}
            />
            <AtListItem
              title='女'
              hasBorder={false}
              onSwitchChange={this.handleChange}
            />
          </AtList >
        </View>
        <View className='d'>
          <AtList hasBorder={false}>
            <AtListItem
              title='出生日期：1998年11月06日'
              arrow='right'
              hasBorder={false}
            />
          </AtList>
        </View>
        <AtList hasBorder={false}>
          <AtListItem
            title='所在城市：'
            arrow='right'
            extraText='广东广州'
            hasBorder={false}
          />
        </AtList>
        <View className='haojihaoma'>
          <AtInput className='shouji'
            name='value'
            title='手机号码：'
            type='number'
            placeholder=''
            value={this.state.value}
            onChange={this.handleChange.bind(this)}
          />
        </View>
        <View className='haojihaoma'>
          <AtInput className='shouji'
            name='value'
            border={false}
            title='过敏史：'
            type='text'
            placeholder=''
            value={this.state.value}
            onChange={this.handleChange.bind(this)}
          />
        </View>
        <View className='jiwnagbingshi'>
          <View className='jiwang'>既往病史</View>
          <AtInput className='guomin'
            name='value'
            title='外伤、手术、输血史：'
            type='text'
            border={false}
            placeholder=''
            value={this.state.value}
            onChange={this.handleChange.bind(this)}
          />
          <AtInput className='guomin'
            name='value'
            title='重大疾病史：'
            type='text'
            border={false}
            placeholder=''
            value={this.state.value}
            onChange={this.handleChange.bind(this)}
          />
          <AtInput className='guomin'
            name='value'
            title='肝肾功能状况：'
            type='text'
            border={false}
            placeholder=''
            value={this.state.value}
            onChange={this.handleChange.bind(this)}
          />
          <AtInput className='guomin'
            name='value'
            title='放化疗：'
            type='text'
            border={false}
            placeholder=''
            value={this.state.value}
            onChange={this.handleChange.bind(this)}
          />
          <View className='jiwang1'>慢性病史:</View>
        <AtCheckbox
        options={this.checkboxOption}
        selectedList={this.state.checkedList}
        onChange={this.handleChange.bind(this)}
        />
        <View className='jiwang1'>传染病史:</View>
        <AtCheckbox
        options={this.checkboxOption1}
        selectedList={this.state.checkedList}
        onChange={this.handleChange.bind(this)}
        />
        </View>
        <View className='jiwnagbingshi'>
        <View className='jiwang'>家族病史</View>
          <AtInput className='guomin'
            name='value'
            title='家族遗传史：'
            type='text'
            border={false}
            placeholder=''
            value={this.state.value}
            onChange={this.handleChange.bind(this)}
          />
          <AtInput className='guomin'
            name='value'
            title='免疫性和精神病史：'
            type='text'
            border={false}
            placeholder=''
            value={this.state.value}
            onChange={this.handleChange.bind(this)}
          />
           <AtInput className='guomin'
            name='value'
            title='与患者关系：'
            type='text'
            border={false}
            placeholder=''
            value={this.state.value}
            onChange={this.handleChange.bind(this)}
          />
        </View>
        <AtList hasBorder={false}>
          <AtListItem onClick={this.dianzi}
            title='电子病历：'
            arrow='right'
            extraText='查看病历'
            hasBorder={false}
          />
        </AtList>
        <AtList hasBorder={false}>
          <AtListItem onClick={this.wenzhen}
            title='问诊记录：'
            arrow='right'
            extraText='查看问诊记录'
            hasBorder={false}
          />
        </AtList>
        <View className='f'>
          <AtButton full onClick={this.geren}>保存</AtButton>
        </View>
      </View>
    )

  }


}

